package com.xgimi.open.skill.datamanager.domain.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 产品表
 * @TableName product
 */
@TableName(value ="product")
@Data
public class ProductDo implements Serializable {
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * icon图片url地址
     */
    private String iconPic;

    /**
     * 产品名称
     */
    private String productName;

    /**
     * 项目组
     */
    private String projectGroup;

    /**
     * 创建方式（0：空；1：自定义创建；2：通过行业模板创建）
     */
    private Integer creationMethod;

    /**
     * 类型（1：全链路技术；2：单项技术）
     */
    private Integer type;

    /**
     * 操作系统（1：Android，2：Linux）
     */
    private Integer operatingSystem;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 更新人
     */
    private String updatedBy;

    /**
     * 更新时间
     */
    private Date updatedAt;

    /**
     * 产品介绍
     */
    private String productDesc;

    /**
     * 产品的状态（0：未发布，无版本；1：开发中，有版本，但没有已发布的版本；2：已发布，有已发布的版本）
     */
    private Integer productStatus;

    /**
     * 软删除状态标志（0：未删除，1：已删除，默认：0）
     */
    @TableLogic
    private Integer deleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProductDo other = (ProductDo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getIconPic() == null ? other.getIconPic() == null : this.getIconPic().equals(other.getIconPic()))
            && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
            && (this.getProjectGroup() == null ? other.getProjectGroup() == null : this.getProjectGroup().equals(other.getProjectGroup()))
            && (this.getCreationMethod() == null ? other.getCreationMethod() == null : this.getCreationMethod().equals(other.getCreationMethod()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getOperatingSystem() == null ? other.getOperatingSystem() == null : this.getOperatingSystem().equals(other.getOperatingSystem()))
            && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getUpdatedBy() == null ? other.getUpdatedBy() == null : this.getUpdatedBy().equals(other.getUpdatedBy()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
            && (this.getProductDesc() == null ? other.getProductDesc() == null : this.getProductDesc().equals(other.getProductDesc()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getIconPic() == null) ? 0 : getIconPic().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        result = prime * result + ((getProjectGroup() == null) ? 0 : getProjectGroup().hashCode());
        result = prime * result + ((getCreationMethod() == null) ? 0 : getCreationMethod().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getOperatingSystem() == null) ? 0 : getOperatingSystem().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedBy() == null) ? 0 : getUpdatedBy().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        result = prime * result + ((getProductDesc() == null) ? 0 : getProductDesc().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", iconPic=").append(iconPic);
        sb.append(", productName=").append(productName);
        sb.append(", projectGroup=").append(projectGroup);
        sb.append(", creationMethod=").append(creationMethod);
        sb.append(", type=").append(type);
        sb.append(", operatingSystem=").append(operatingSystem);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedBy=").append(updatedBy);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", productDesc=").append(productDesc);
        sb.append(", deleted=").append(deleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}